﻿using System;
using System.Collections.Generic;
using System.Linq.Expressions;

namespace GwLib.UnitTesting
{
    public interface ITestStorage
    {
        void SetDefaultCopyImplementation(Func<object, object> copyDelegate);
        void SetCopyImplementation<T>(Func<object, object> copyDelegate) where T : class, new();
        void AddTrigger<T>(ObjectStoreTriggerType triggerType, Action<T, List<T>> trigger) where T : class, new();

        void Reset();
        void Reset<T>() where T : class, new();
        int GetCount<T>() where T : class, new();
        IObjectStore<T> GetObjectStore<T>() where T : class, new();

        T Insert<T>(T obj) where T : class, new();
        T UpdateWhere<T>(T obj, Func<T, bool> where) where T : class, new();
        T UpdateByColumn<T>(T obj, Expression<Func<T, object>> columnExpression) where T : class, new();
        int DeleteWhere<T>(Func<T, bool> where) where T : class, new();
        int DeleteByColumn<T>(T obj, Expression<Func<T, object>> columnExpression) where T : class, new();
        T SelectOne<T>(Func<T, bool> where = null) where T : class, new();
        List<T> SelectList<T>(Func<T, bool> where = null) where T : class, new();

    }
}
